<?php /* Smarty version 2.6.18, created on 2015-09-01 18:38:52
         compiled from cdkUse.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "top.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<style>
.middle {
	*position: absolute;
	*top: 50%;
}
</style>

<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs"><script
	type="text/javascript">
	try {
		ace.settings.check('breadcrumbs', 'fixed')
	} catch (e) {
	}
</script>

<ul class="breadcrumb">
	<li><i class="icon-home home-icon"></i> <a
		href="index.php">首页</a></li>
</ul>
<!-- .breadcrumb --></div>

<div class="page-content">

<div class="row">
<div class="col-xs-12"><!-- PAGE CONTENT BEGINS -->

<div class="row">
<div class="col-sm-12">
<div class="widget-box">
<div class="widget-header header-color-blue2">cdk使用情况
<h4 class="lighter smaller"></h4>
</div>

<div class="widget-body">
<div class="widget-main padding-8">
<form class="form-horizontal" role="form">

<center>

<div class="form-group"><label
	class="col-sm-6 control-label no-padding-right" for="form-field-1"><strong>cdk使用情况</strong></label>
<span> &nbsp;</span></div>

<table style="width: 80%;" id="sample-table-1"
	class="table table-striped table-bordered table-hover ">
	<thead>
		<tr>
			<th class="col-sm-1">类别</th>
			<th class="col-sm-1">条件</th>
			<th class="col-sm-1">操作</th>

		</tr>
	</thead>

	<tbody>
		<tr>

			<th style="width: 50%;"><label
				class="col-sm-6 control-label no-padding-right" for="form-field-5">CDK</label>
			</th>
			<th class="col-sm-6">
			<div class="col-sm-2"><input type="text" id="selectCdk"
				placeholder="" style="width: 250px;" class="col-xs-1 col-sm-1" /></div>
			</th>
			<th align=center class="col-sm-1">
			<center>
			<button valign="bottom" type="button" onclick="selectCdkInfo();"
				class="btn btn-info btn-success">查询</button>
			</center>
			</th>
		</tr>

	</tbody>
</table>
</center>
</form>
<div class="table-responsive">
<center>

<table style="width: 80%;" id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>cdkey</th>
			<th>游戏</th>
			<th>使用平台</th>
			<th>使用服务器</th>
			<th>玩家id</th>
			<th>玩家名字</th>
			<th>使用时间</th>
			<th>cdkey奖励内容</th>
		</tr>
	</thead>

	<tbody>

		<?php if ($this->_tpl_vars['errorMsg']): ?>
		<tr>
			<td style="color: red" colspan="8">
			<center><?php echo $this->_tpl_vars['errorMsg']; ?>
</center>
			</td>
		</tr>
		<?php elseif ($this->_tpl_vars['game']): ?>
		<tr>
			<td><?php echo $this->_tpl_vars['cdk']; ?>
</td>
			<td><?php echo $this->_tpl_vars['game']; ?>
</td>
			<td><?php echo $this->_tpl_vars['platform']; ?>
</td>
			<td><?php echo $this->_tpl_vars['server']; ?>
</td>
			<td><?php echo $this->_tpl_vars['playerid']; ?>
</td>
			<td><?php echo $this->_tpl_vars['playername']; ?>
</td>
			<td><?php echo $this->_tpl_vars['usetime']; ?>
</td>
			<td><?php echo $this->_tpl_vars['reward']; ?>
</td>
		</tr>
		<?php endif; ?>

	</tbody>

</table>
</center>


<center>
<form class="form-horizontal" role="form">

<div class="form-group"><label
	class="col-sm-6 control-label no-padding-right" for="form-field-2"><strong>cdk类型查询</strong></label>
<span> &nbsp;</span></div>
<table style="width: 80%;" id="sample-table-1"
	class="table table-striped table-bordered table-hover ">
	<thead>
		<tr>
			<th class="col-sm-1">类别</th>
			<th class="col-sm-1">条件</th>
			<th class="col-sm-1">操作</th>
		</tr>
	</thead>

	<tbody>
		<tr>
			<td style="width: 50%;"><label
				class="col-sm-6 control-label no-padding-right" for="form-field-5">游
			戏</label></td>
			<td>
			<div class="col-sm-3"><select id="selectGame">
				<option value="">游 戏</option>
				<?php if ($this->_tpl_vars['selectGames']): ?> <?php $_from = $this->_tpl_vars['selectGames']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?> <?php if ($this->_tpl_vars['nowGame'] == $this->_tpl_vars['value']): ?>
				<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
				<?php else: ?>
				<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
				<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
			</select></div>

			</td>
			<td style="padding-top: 25px;" id="middle" rowspan=2 class="col-sm-1">
			<center>
			<button type="button" onclick="selectCdkType();"
				class="btn btn-info btn-success">查询</button>
			</center>

			</td>



		</tr>
		<tr>
			<th class="col-sm-4"><label
				class="col-sm-6 control-label no-padding-right" for="form-field-5">类
			型</label></th>
			<th class="col-sm-6">
			<div class="col-sm-2"><input type="text" id="cdkType"
				placeholder="" style="width: 250px;" class="col-xs-1 col-sm-1" /></div>
			</th>
		</tr>

	</tbody>

</table>
</form>
</center>



<center>

<table style="width:80%;" id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>游戏</th>
			<th>平台</th>
			<th>cdk类型</th>
			<th>cdk奖励内容</th>
			<th>生成时间</th>
			<th>开始时间</th>
			<th>结束时间</th>
			<th>下载</th>
		</tr>
	</thead>

	<tbody>
		<?php if ($this->_tpl_vars['errorMsg2']): ?>
		<tr>
			<td style="color: red" colspan="9">
			<center><?php echo $this->_tpl_vars['errorMsg2']; ?>
</center>
			</td>
		</tr>
		<?php elseif ($this->_tpl_vars['type'] == 0 && $this->_tpl_vars['game2']): ?>
		<tr>
			<td><?php echo $this->_tpl_vars['game2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['platform2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['type2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['reward2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['createtime2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['starttime2']; ?>
</td>
			<td><?php echo $this->_tpl_vars['endtime2']; ?>
</td>
			<th><a class="red" target="_blank" href="<?php echo $this->_tpl_vars['cdkDownloadUrl']; ?>
<?php echo $this->_tpl_vars['game2']; ?>
-<?php echo $this->_tpl_vars['type2']; ?>
.txt">
																<i class="icon-download bigger-130"></i>下载
															</a></th>
		</tr>
		<?php elseif ($this->_tpl_vars['type'] == 1): ?>
		<?php $_from = $this->_tpl_vars['cdkInfo']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cdkInfo']):
?>
		<tr>
			<td><?php echo $this->_tpl_vars['cdkInfo']['game']; ?>
</td>
			<td><?php echo $this->_tpl_vars['cdkInfo']['platform']; ?>
</td>
			<td><?php echo $this->_tpl_vars['cdkInfo']['type']; ?>
</td>
			<td><?php echo $this->_tpl_vars['cdkInfo']['reward']; ?>
</td>
			<td><?php echo $this->_tpl_vars['cdkInfo']['createtime']; ?>
</td>
			<td><?php echo $this->_tpl_vars['cdkInfo']['starttime']; ?>
</td>
			<td><?php echo $this->_tpl_vars['cdkInfo']['endtime']; ?>
</td>
			<th><a class="red" target="_blank" href="<?php echo $this->_tpl_vars['cdkDownloadUrl']; ?>
<?php echo $this->_tpl_vars['cdkInfo']['game']; ?>
-<?php echo $this->_tpl_vars['cdkInfo']['type']; ?>
.txt">
																<i class="icon-download bigger-130"></i>下载
															</a></th>
		</tr>
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>
	</tbody>
</table>
</center>
</div>
<!-- /.table-responsive --></div>
</div>
<!-- /.row --></div>
<!-- /.page-content --></div>
<!-- /.main-content --></div>
</div>
</div>

<!-- /.table-responsive --></div>
</div>
<!-- /.page-content -->
</div>
<!-- /.main-content -->
<script type="text/javascript">
	jQuery(function($) {
		$('.date-picker').datepicker({
			autoclose : true
		}).next().on(ace.click_event, function() {
			$(this).prev().focus();
		});
		/*
		 var oTable1 = $('#sample-table-1').dataTable({
		 "aoColumns" : [ {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, {
		 "bSortable" : false
		 }, 
		 ]
		 });

		 */
		/* { "bSortable": false }
		 */


	});

	function selectCdkInfo() {
		var cdk = $('#selectCdk').val();

		if (!cdk) {
			alert('请输入查询的cdk！');
		} else {
			url = "index.php?mod=Cdk&do=cdkUse&cdk=" + cdk;
			window.location.href = url;
		}

	}

	// 查询cdk类型
	function selectCdkType() {
		var game = $('#selectGame').val();
		var cdkType = $('#cdkType').val();
		if (!game) {
			alert('请选择游戏!');
		} else {
			url = "index.php?mod=Cdk&do=selectCdkType&game=" + game
					+ "&cdkType=" + cdkType;
			window.location.href = url;
		}
	}

	/*	
	 window.onload = function(){
	 var select = document.getElementById('selectGame');
	 select.onchange = function(){
	 // 更改值后执行的代码
	 var gameName = jQuery("#selectGame  option:selected").text();
	 var _tagNum = 1;
	 $.ajax({
	 type: "POST",
	 url: "index.php?mod=Game&do=getPlatformByGame&game=" + gameName,
	 data: "",
	 dataType: 'html',
	 success: function(data) {					
	 var dataObj = eval("(" + data + ")");//转换为json对象
	
	 if(dataObj == null) {
	 $("#platform").empty();
	 $("#platform").append('<option value="" id="selectPlatform">平    台</option>');
	 $("#channel").empty();
	 $("#channel").append('<option value="" id="selectChannel">渠    道</option>');
	 }
	
	 var platform = dataObj.platform;
	 $("#platform").empty();
	 $("#platform").append('<option value="" id="selectPlatform">平    台</option>');
	 for(var i=0;i<platform.length;i++){
	 $("#platform").append("<option value='"+platform[i]+"' >"+platform[i]+"</option>"+"<br/>");
	 }
	
	 var channel = dataObj.channel;
	 $("#channel").empty();
	 $("#channel").append('<option value="" id="selectChannel">渠    道</option>');
	 for(var i=0;i<channel.length;i++){
	 $("#channel").append("<option value='"+channel[i]+"' >"+channel[i]+"</option>"+"<br/>");
	 }
	 }
	 });
	 }
	
	 } 
	 */
</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
